< previous page page_77 next page >

Page 77
The solution as a software entity
The design steps or rules for constructing the solution
The forces leading to the solution
Evidence that the solution resolves forces
The details that are allowed to vary and those that aren't
One (at a minimum) actual instance of use (others suggest three)
Evidence of generality across different instances
Variants and subpatterns
Other patterns that it relies on
Other patterns that rely on it
A relationship to other patterns with similar contexts, problems, or solutions
When to Use Design Patterns in Your Project
Because design patterns are a somewhat advanced topic, you might not want to delve into them until (1) you have access to an OO mentor/architect who is knowledgeable about implementing design patterns, and/or (2) time is allocated toward the end of the first release of the projector sometime thereafterto examine the need and implementation of design patterns. Attempting both to learn OOP and to design patterns can be an overwhelming process, so pace yourself. Meanwhile, the next two subsections provide you with examples of design patterns that you can use in your Visual Basic code.
The Singleton Pattern Example: An Overview
If you had any experience with Visual Basic 3.0 programming, you probably remember how difficult it was to allow users to start only one instance of your application. If you've been doing a little object-oriented programming, you might have come to the point where you need to make sure only one instance of a particular object is in memory. The Singleton design pattern is analogous to the first situation and is a solution to the second one.
The purpose of the Singleton pattern is to make sure that only one instance of an object is available to prospective client objects. The enforcement of one object instance can be important if that object is global within your application and even more so if that object is global to other applications within an enterprise or across several enterprises. An example of a Singleton object is a reporting object that resides on a server and is the broker for all requests for reporting services.

 
< previous page page_77 next page >

If you like this book, buy it!